export const getFormConfig = (type, configData) => {
    switch (type) {
        case 'select':
            return {
                formItems: [
                    { component: 'select', name: 'dataset', label: '数据集设置', span: 6, options: { items: configData.dbServiceList } },
                    { component: 'switchv', name: 'multiple', label: '是否多选', span: 6, options: {} },
                    { component: 'inputNumber', pattern: 'simple', name: 'limit', label: '最多选择', span: 6, options: { min: 0 } }
                ]
            }
            break;
        case 'switchv':
            return {
                formItems: [
                    { component: 'input', pattern: 'simple', name: 'activeValue', label: '选中值', span: 6, options: {} },
                    { component: 'input', pattern: 'simple', name: 'inactiveValue', label: '未选中值', span: 6, options: {} },
                ]
            }
            break;
        case 'cascader':
            return {
                formItems: [
                    { component: 'select', name: 'dataset', label: '数据集设置', span: 6, options: { items: configData.dbServiceList } },
                    { component: 'switchv', name: 'multiple', label: '是否多选', span: 6, options: {} },
                    { component: 'switchv', name: 'checkStrictly ', label: '每级可选', span: 6, options: {} },
                    { component: 'inputNumber', pattern: 'simple', name: 'limit', label: '最多选择', span: 6, options: { min: 0 } },
                ]
            }
            break;
        case 'treeSelect':
            return {
                formItems: [
                    { component: 'select', name: 'dataset', label: '数据集设置', span: 6, options: { items: configData.dbServiceList } },
                    { component: 'switchv', name: 'multiple', label: '是否多选', span: 6, options: {} },
                    { component: 'switchv', name: 'checkStrictly ', label: '每级可选', span: 6, options: {} },
                    { component: 'switchv', name: 'lazyTree ', label: '点击加载数据', span: 6, options: {} },
                    { component: 'switchv', name: 'showCheckbox', label: '显示选择框', span: 6, options: {} },
                    { component: 'inputNumber', pattern: 'simple', name: 'limit', label: '最多选择', span: 6, options: { min: 0 } },
                ]
            }
            break;
        case 'datePicker-simple':
            return {
                formItems: [
                    { component: 'select', name: 'dateType', label: '日期类型', span: 6, options: { items: [{ value: 'year', label: '年' }, { value: 'month', label: '月' }, { value: 'date', label: '日' }, { value: 'dates', label: '多个日期' }, { value: 'week', label: '周' }, { value: 'datetime', label: '日期时间' }, { value: 'datetimerange', label: '日期时间范围' }, { value: 'daterange', label: '日期范围' }, { value: 'monthrange', label: '月份范围' }] } },
                    { component: 'input', pattern: 'simple', name: 'valueFormat', label: '日期格式', span: 6, options: {} },
                ]
            }
    }
}